<script>
  /*
  * Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
    * This file is part of RockStor.
    *
    * RockStor is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published
    * by the Free Software Foundation; either version 2 of the License,
    * or (at your option) any later version.
    *
    * RockStor is distributed in the hope that it will be useful, but
    * WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    * General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program. If not, see <http://www.gnu.org/licenses/>.
    *
    */
</script>
<div class="messages"></div>
<div class="pull-left">
  {{#if snapshotsNotEmpty}}
  <a class="btn btn-danger" href="#" id="js-snapshot-delete-multiple" style="visibility:hidden;"><i class="glyphicon glyphicon-trash "></i> Delete selected</a>
  {{/if}}
</div>
<div class="pull-right">
  <a class="btn btn-primary" href="#" id="js-snapshot-add"><i class="glyphicon glyphicon-edit "></i> Create</a>
  <a class="btn btn-primary" href="#scheduled-tasks" ><i class="glyphicon glyphicon-tasks "></i> Schedule </a>
</div>
</br>
</br>

{{#if snapshotsNotEmpty}}

<table id="snapshots-table" class="table table-bordered table-striped share-table data-table" width="100%" summary="List of snapshots">
  <thead>
    <tr>
      <th>
        <input class="js-snapshot-select-all inline" type="checkbox" name="snapshot-select-all" ></input>
      </th>
      <th>Snapshot Name</th>
      <th>Created on</th>
      <th>Share</th>
      <th>Visibility to user</th>
      <th>Writable</th>
      <th>Total Size</th>
      <th>Exclusive Size</th>
    </tr>
  </thead>
  <tbody>
  {{#each snapshots}}
          <tr>
              <td><input class="js-snapshot-select inline" type="checkbox" name="snapshot-select" 
              data-name="{{this.name}}" data-id='{{this.id}}' {{checkboxValue this.name}}></input>
              </td>
              <td><i class="glyphicon glyphicon-camera"></i> {{this.name}} &nbsp;&nbsp;&nbsp;&nbsp;
               {{#if this.writable}}
                    <a class="js-snapshot-clone" href="#" data-name="{{this.name}}" data-share-name="{{this.share}}">
                    <i rel="tooltip" title="Clone snapshot" class="glyphicon glyphicon-book"></i></a>
               {{/if}}
                <a href="#" class="js-snapshot-delete" id="delete_snapshot_{{this.name}}" data-name="{{this.name}}" data-size="{{getSize this.eusage}}" 
                data-share-name="{{this.share}}" data-action="delete" title="Delete snapshot">
                <i rel="tooltip" title="Delete snapshot" class="glyphicon glyphicon-trash"></i></a>
               </td>
              <td>{{getToc this.toc}}</td>
              <td><a href="#shares/{{this.share}}">{{this.share}}</a></td>
               <td>
               {{#if this.uvisible}}
                    Visible
               {{else}}
                    Hidden
               {{/if}}
               </td>
               <td>
               {{#if this.writable}}
                    Yes
               {{else}}
                    No
               {{/if}}
               </td>
               <td>{{getSize this.rusage}}</td>
               <td>{{getSize this.eusage}}</td>
          </tr>
  {{/each}}
  </tbody> 
  </table>
  {{else}}
  <div class="alert alert-warning"><h4>There are no snapshots to display</h4></div>
  {{/if}}
 
  
  
  
  
